#include "admin.h"
#include "manager.h"

//主界面菜单
void menu(void)
{
    system("clear");
    puts("*****图书管理模块*****");
	puts("1、管理员");
	puts("2、操作员");
	puts("3、退出系统");
}

int main(int argc,const char* argv[])
{
	cnt_operator = load_data(operator,sizeof(operator),"operator.dat") / sizeof(Operator);
	signal(SIGALRM,sigalrm);
	alarm(1);
	for(;;)
	{
		menu();
		switch(get_cmd('1','4'))
		{
		case '1': admin();  	    break;
		case '2': manager();		break;
		case '3': save_data(operator,sizeof(Operator)*cnt_operator,"operator.dat");
			return 0;
		}
	}
}